package com.hospital.hospitalrelay.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.math.BigDecimal;
import java.util.Date;
import java.io.Serializable;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 患者表
 * </p>
 *
 * @author 闫腾腾
 * @since 2020-10-21
 */
@Data
@Accessors(chain = true)
public class Sickperson extends Model<Sickperson> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 患者姓名
     */
    private String name;

    /**
     * 患者卡号
     */
    private String serialnumber;

    /**
     * 年龄
     */
    private Integer age;

    /**
     * 出生日期
     */
    private Date birth;

    /**
     * 性别0女1男
     */
    private Integer sex;

    /**
     * 手机号码
     */
    private String phone;

    /**
     * 证件号码
     */

    private String personid;

    /**
     * 患者来源
     */
    @TableField("source_id")
    private Integer sourceId;

    /**
     * 会员类型
     */
    @TableField("vipgrade_id")
    private Integer vipgradeId;

    /**
     * 到期时间
     */
    private Date vipenddate;

    /**
     * 民族
     */
    private String nation;

    /**
     * 婚姻状态
     */
    @TableField("marital_id")
    private Integer maritalId;

    /**
     * 学历
     */
    @TableField("education_id")
    private Integer educationId;

    /**
     * 省
     */
    private Integer province;

    /**
     * 市
     */
    @TableField("city_id")
    private Integer cityId;

    /**
     * 详细地址
     */
    private String address;

    /**
     * 职业
     */
    @TableField("work_id")
    private Integer workId;

    /**
     * 工作单位
     */
    private String workaddress;

    private String desc;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createtime;

    @TableField("doctor_id")
    private Integer doctorId;

    /**
     * 订单id
     */
    @TableField("indents_id")
    private Integer indentsId;

    /**
     * 科室id
     */
    @TableField("subject_id")
    private Integer subjectId;

    /**
     * 接诊类型
     */
    @TableField("medicalrecordtype_id")
    private Integer medicalrecordtypeId;

    /**
     * 诊断
     */
    @TableField("diagnosis_id")
    private Integer diagnosisId;

    /**
     * 医嘱
     */
    @TableField("advice_id")
    private Integer adviceId;

    /**
     * 支付方式
     */
    @TableField("payment_id")
    private Integer paymentId;

    private BigDecimal receipts;
    private BigDecimal receivble;

    private Integer pid;
    private Integer cid;
    private Integer did;
    private Integer states;


    //扩展字段
    private String dnumber;//订单编号
    private String dtype;//订单类型
    private String subname;//科室名称
    private String docname;//医生姓名
    private String aaaa;//查询订单编号/患者姓名
    private String aname;//医嘱
    private String dname;//诊断
    private String mname;//接诊类型
    private String areaname;//地区名称
    private String pname;//省
    private String cname;//市
    //区间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date ct1;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date ct2;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }



}
